package es.ats.codington.festival.mappers;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import es.ats.codington.festival.domain.People;

/**
 * 
 * @author Codington_RED
 *
 */

public class PeopleMapper implements RowMapper<People>{

	/**
	 * 
	 * @param resultSet
	 * @param numRow
	 * @return people 
	 * @throws SQLException
	 */
	@Override
	public People mapRow(ResultSet resultSet, int numRow) throws SQLException {
		People people = new People();
		
		 people.setIdPeople(resultSet.getInt("idPeople"));
		 people.setFirstName(resultSet.getString("firstName"));
		 people.setLastName(resultSet.getString("lastName"));
		 people.setDni(resultSet.getString("dni"));
		 people.setEmail(resultSet.getString("email"));
		 people.setPhoneNumber(resultSet.getString("phoneNumber"));
		 people.setAddress(resultSet.getString("address"));
		 
		 return people;
	}

}
